package cn.bfay.lion.rest.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * LoginParam.
 *
 * @author wangjiannan
 * @since 2019/10/23
 */
@Data
public class LoginParam implements Serializable {
    private static final long serialVersionUID = -2696064317943058403L;

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "请输入用户名")
    @Pattern(regexp = "^[a-zA-Z0-9]{4,16}$", message = "用户名为4-16位字母、数字")
    private String username;

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "请输入密码")
    @Pattern(regexp = "^[a-zA-Z0-9!@#$%^&*]{6,18}$", message = "密码为6到18位字母、数字、特殊符号")
    private String password;

    @ApiModelProperty(value = "验证码")
    @NotBlank(message = "请输入验证码")
    private String captchaCode;
}
